﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using FanaticRock.Core.Helpers;

namespace FanaticRock.ViewModels
{
    [INotifyPropertyChanged]
    public partial class AlbumViewModel
    {
        #region props

        [ObservableProperty]
        private long _id;

        [ObservableProperty]
        private string _name;

        [ObservableProperty]
        private string _description;

        [ObservableProperty]
        private Uri _cover;

        #endregion

        #region ctors

        public AlbumViewModel()
        {

        }

        public AlbumViewModel(FanaticRock.MediaSource.BilibiliAPI.ResponseDto.Fav.Folder.InfoResponseDto info)
        {
            var data = info.Data;
            _id = data.Id;
            _name = data.Title;
            _description = data.Intro;
            _cover = UriHelper.GetUri(data.Cover);

            if (string.IsNullOrWhiteSpace(_description))
                _description = "该收藏夹暂无简介";
        }

        #endregion
    }
}
